package com.abocode.aichat.data;

/**
 * @author guanxf
 */
public class StanzaWrapper {

    private final static int offline_code=201;
    private final static int online_code=200;
    private final static int success_code=200;


    public final static MessageStanza wrapper(MessageStanza stanza, MessageBody body) {
        return new MessageStanzaImpl(stanza.id(), body, stanza.moduleType(), stanza.moduleServiceType());
    }

    public final static MessageStanza wrapperSuccess(MessageStanza stanza) {
        return new MessageStanzaImpl(stanza.id(), success(success_code), stanza.moduleType(), stanza.moduleServiceType());
    }

    public final static MessageStanza wrapperOffline(MessageStanza stanza) {
        return new MessageStanzaImpl(stanza.id(), success(offline_code), stanza.moduleType(), stanza.moduleServiceType());
    }
    public final static MessageStanza wrapper(MessageStanza stanza, int code ) {
        return new MessageStanzaImpl(stanza.id(), success(code), stanza.moduleType(), stanza.moduleServiceType());
    }

    public final static MessageStanza wrapperOnline(MessageStanza stanza) {
        return new MessageStanzaImpl(stanza.id(), success(online_code), stanza.moduleType(), stanza.moduleServiceType());
    }

    public final static MessageBody success(int code) {
        return new RespMessage(code);
    }
}
